<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * Override site URL function
 */
class MY_Config extends CI_Config {

	function __construct()
	{
		parent::__construct();
		
		
	}

	/**
	 * Site URL
	 *
	 * @access	public
	 * @param	string	the URI string
	 * @return	string
	 */
	function site_url($uri = '')
	{
		if ($uri == '')
		{
			//Zeljko:following 1 line changed, removed the last part, to remove the index.php
			return $this->slash_item('base_url')/*.$this->item('index_page')*/;
		}

		if ($this->item('enable_query_strings') == FALSE)
		{
			if (is_array($uri))
			{
				$uri = implode('/', $uri);
			}

			//$index = $this->item('index_page') == '' ? '' : $this->slash_item('index_page');
			//Zeljko:following 1 line added, to remove index.php, previous line commented
			$index = '';
			$suffix = ($this->item('url_suffix') == FALSE) ? '' : $this->item('url_suffix');
			return $this->slash_item('base_url').$index.trim($uri, '/').$suffix;
		}
		else
		{
			if (is_array($uri))
			{
				$i = 0;
				$str = '';
				foreach ($uri as $key => $val)
				{
					$prefix = ($i == 0) ? '' : '&';
					$str .= $prefix.$key.'='.$val;
					$i++;
				}

				$uri = $str;
			}

			//Zeljko
			//Following line changed (original line still here) to remove the index.php in the url
			//return $this->slash_item('base_url').$this->item('index_page').'?'.$uri;
			return $this->slash_item('base_url').$this->item('index_page').'?'.$uri;
		}
	}

}

// END CI_Config class

/* End of file Config.php */
/* Location: ./system/core/Config.php */